package com.lznb.cloud.repository;

import com.lznb.cloud.entity.News;
import com.lznb.cloud.entity.Users;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import sun.security.util.Password;

import java.util.List;

/**
 * 新闻表
 * @author mzy
 * @email 1992lcg@163.com
 * @date ${datetime}
 */
public interface UsersRepository extends JpaRepository<Users, String>, JpaSpecificationExecutor<Users> {


    /**\
     * 登录
      * @param username
     * @param password
     * @return
     */
    @Query("select u from Users u where  u.username=:username and u.pwd=:password")
    Users login(@Param("username") String username, @Param("password") String password);

}
